Skip to main content

English

Index

  1. Login to the chip
    1. Python environment
    2. Qiboconnection
  2. Running jobs
    1. Submit to queue
    2. View jobs sended

Login to the chip

IMPORTANT

The accounts are for personal and non-transferable usage.

Python environment

Remote access will be possible using the “qiboconnection” Python library. The minimum Python version required is 3.10. It is recommended to have a Python environment. That can be done with the conda or venv tools.

pip install qiboconnection

Qiboconnection

We will need to import the qiboconnection API class to interact with the chip.

from qiboconnection.api import API
from qiboconnection.connection import ConnectionConfiguration

Once imported, it will be necessary to enter the credentials.

configuration = ConnectionConfiguration(username = "USER",api_key = "API_KEY")
connection = API( configuration = configuration)

Running jobs

Submit to queue

To send jobs to the chip, you must select the device. We can see the available devices with the following command:

connection.list_devices()

We select the quantum chip, usually with id = 9.

connection.select_device_ids(device_ids=9)

Now we can prepare the circuit that we want to run.

from qibo.models import Circuit
from qibo import gates
circuit = Circuit(nqubits = 1)
circuit.add(gates.X(0))
circuit.add(gates.M(0))

Then, we execute the circuit, which will be sent to the queue.

job_ids = connection.execute(circuit=circuit)

We will be able to see the status of the job and its result when it finishes with this API call:

results = connection.get_results(job_ids=job_ids)

View jobs sended

To show all the submitted jobs, we need to use the API.

Show all the submitted jobs:
jobs_df = connection.list_jobs().dataframe
Pending jobs:
jobs_df[(jobs_df['job_type']=='circuit') & (jobs_df['status']=='pending')]
Quantum circuit:
circuit_data = connection.get_job(job_id=1)
circuit_data.description.draw()
Job result:
circuit_data.result